home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
FNTPAK32.ZIP
/
BASIC.EXE
/
DEMOBRIT.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-08-16
|
4KB
|
145 lines
DEFINT A-Z
'$INCLUDE: 'Font_Pak.Inc' '... For QB/PDS/VB-DOS
'======================================================== PowerBasic Users
''$INCLUDE "Font_Pak.Inc" '... PB users, UN-REM these lines
''$Link "FontPakP.OBJ" '... SHAREWARE users
''$Link "Video.OBJ" '... REGISTERED users
''$Link "Fonts.OBJ" '... REGISTERED users
'======================================================== PowerBasic Users
'============================================================ DemoBrit.Bas
'
' A Font Pak Demonstration Copyright 1991-1994 Rob W. Smetana
'
' Demonstrate calling BrightBG and DefaultPalette to toggle
' bright backgrounds on/off -and- selecting a different palette
' to preserve blinking while also getting bright backgrounds.
'
' Requires: - An EGA or VGA monitor.
'
' - Font_Pak.Lib (QB/PDS/VB-DOS) -or- Font_Pak.PBU (PowerBasic)
'
'
'============================================================ DemoBrit.Bas
DECLARE SUB Demo.Bright.Backgrounds ()
COLOR 7, 1: CLS
CALL fpInitialize '=== SHAREWARE versions ONLY
Demo.Bright.Backgrounds '=== demo of Bright Background colors
CLS
'
SUB Demo.Bright.Backgrounds
'==================================== Demo BOTH BrightBG and DefaultPalette
CLS
PRINT " This demonstrates CALLing BrightBG (OnorOff) -- Bright Backgrounds."
LOCATE 25, 34: PRINT "Press a key.";
d$ = INPUT$(1)
LOCATE 2, 1
Clr = 0: GOSUB PrintIt 'Clr = 0 ===> normal Black
Clr = 16: GOSUB PrintIt 'Clr =16 ===> blinking Black
COLOR 7, 1
d$ = INPUT$(1)
'=== turn ON bright backgrounds (use ANY non-zero value)
CALL BrightBG(1)
d$ = INPUT$(1)
'=== turn OFF bright backgrounds
CALL BrightBG(0)
d$ = INPUT$(1)
CLS
PRINT " Now we'll do the same using CALL DefaultPalette (2) -- and preserve blinking."
LOCATE 25, 34: PRINT "Press a key.";
d$ = INPUT$(1)
LOCATE 2, 1
Clr = 0: GOSUB PrintIt 'Clr = 0 ===> normal Black
Clr = 16: GOSUB PrintIt 'Clr =16 ===> blinking Black
COLOR 7, 1
d$ = INPUT$(1)
'=== turn ON bright backgrounds (in this case, PRESERVE blinking)
CALL DefaultPalette(2)
d$ = INPUT$(1)
'=== restore the default color palette
CALL DefaultPalette(0)
d$ = INPUT$(1)
CLS
PRINT " Finally, since many people like Dark Blue backgrounds, call DarkBlue . . ."
LOCATE 25, 34: PRINT "Press a key.";
d$ = INPUT$(1)
LOCATE 2, 1
Clr = 0: GOSUB PrintIt 'Clr = 0 ===> normal Black
Clr = 16: GOSUB PrintIt 'Clr =16 ===> blinking Black
COLOR 7, 1
d$ = INPUT$(1)
'=== turn on JUST Dark Blue background
CALL DarkBlue
d$ = INPUT$(1)
'=== restore the default color palette
CALL DefaultPalette(0)
d$ = INPUT$(1)
EXIT SUB
'===================================================== do the actual printing
PrintIt:
PRINT : PRINT
Char = 65 '===start with Chr$(65) -- "A"
FOR Back = 0 TO 7
LOCATE , 8
FOR Fore = Clr TO Clr + 15
COLOR Fore, Back
PRINT " "; CHR$(Char); " ";
Char = Char + 1
NEXT
PRINT
NEXT
RETURN
END SUB